<layout name='layout_page' />
<style>
.form-group p{ color: #3498db}
</style>

<div class="row">
	<div class="col-lg-12">
		<div class="row">
			<div class="col-lg-12">
				<ol class="breadcrumb">
					<li><a href="<{:U('Index/index')}>">Home</a></li>
					<li class="active"><span>Appointment</span></li>
				</ol>
				<h1>Appointment Detail</h1>
			</div>
		</div>


		<div class="row">
			<div class="col-lg-8">
				<div class="main-box no-header clearfix">
					<div class="main-box-body clearfix">
						<form id="ajaxForm" action="<{:U('Appointment/updatestate')}>" method="post" class="form-horizontal form-validata">
							<?php if($list['toID']==$userid){ ?>
							<div class="form-group menteesBase">
								<img src="<{$list['fromFace']|getFace=###}>">
								<p><{$list['fromName']}></p>
							</div>
							<?php }else{ ?>
							<div class="form-group menteesBase">
								<img src="<{$list['toFace']|getFace=###}>">
								<p><{$list['toName']}></p>
							</div>
							<?php } ?>	
							<div class="form-group">
								<label>Date</label>								
								<p><{$list['date']|date="F,d,Y",###}></p>
							</div>
		

							<div class="form-group">
								<label>Time</label>		
								<p><{$list.time}></p>						
								</div>

							<div class="form-group">
								<label>Address</label>								
								<p><{$list.address}></p>
								<br/>
								<p><{$list.address1}></p>
							</div>							

							<div class="form-group">
								<div class="row">
									<div class="col-xs-4">
										<label>City</label>
										<p><{$list.city}></p>
									</div>

									<div class="col-xs-4">
										<label>State</label>
										<p><{$list.state}></p>
									</div>

									<div class="col-xs-4">
										<label>Zip code</label>
										<p><{$list.zip}></p>
									</div>
								</div>					
							</div>

							<div class="form-group">
								<label for="exampleTextarea">Message</label>
								<p><{$list.content}></p>
							</div>	

							<?php if($list['toID']==$userid && $list['status']==2){ ?>

							<div class="form-group">
								<label>Status</label>								
								<div class="radio">
									<input <eq name="list['status']" value="1">checked="checked"</eq> type="radio" name="status" id="optionsRadios1" value="1">
									<label for="optionsRadios1">passing</label>
								</div>
								<div class="radio">
									<input <eq name="list['status']" value="-1">checked="checked"</eq> type="radio" name="status" id="optionsRadios2" value="-1">
									<label for="optionsRadios2">rejected</label>
								</div>
							</div>

							<div class="form-group">
								<label>Reasons for refusal</label>
								<textarea class="form-control" name="remark" id="remark" rows="5" style="width:500px"><{$list['remark']}></textarea>
							</div>

							<div class="form-group">				
								<button type="submit" id="myBtn" class="btn btn-success">Update Appointment</button>	
							</div>

							<?php }else{?>

							<div class="form-group">
								<label>Status</label>
								<p><switch name="list.status" >
									<case value="1">passing</case>
									<case value="-1">rejected</case>
									<default />Pending treatment
									</switch>
								</p>							
							</div>
							
							<div class="form-group">
								<label>Reasons for refusal</label>
								<p><{$list['remark']}></p>
							</div>

							<div class="form-group">				
								<button type="button" id="myBtn" class="btn btn-success" onclick="window.history.go(-1)">Go Back</button>	
							</div>

							<?php } ?>	

							

							<input type="hidden" name="id" value="<{$list['id']}>">
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function(){
	ajaxForm();
})
</script>